# for i in range(1, 10):
#     for j in range(1, i + 1):
#         print("{}*{}={}".format(j, i, j*i), end='\t')
#     print()
#     # python


# l = [i for j in [[1, 2, 3], [3, 4, 5]] for i in j]
# print(l)
'''
有n个人围成一圈，顺序排号。从第一个人开始报数（从1到3报数），凡报到3的人退出圈子，问最后留下的是原来第几号的那位。
'''

l1 = [i for i in range(1, 6)]
a = 0

while len(l1) > 1:
    l2 = l1[:]
    for i in range(0, len(l1)):
        a += 1
        if a % 3 == 0:
            a = 0
            l1.remove(l2[i])
            print("-----------")

print(l1)


